<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book Python爬虫课程讲义 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>源码自带项目说明 | Python爬虫课程讲义</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="BigCat">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-tbfed-pagefooter/footer.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../file/part07/7.2.html" />
    
    
    <link rel="prev" href="../../file/part07/7.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="7.1"
        data-chapter-title="源码自带项目说明"
        data-filepath="file/part07/7.1.md"
        data-basepath="../.."
        data-revision="Thu Feb 09 2017 09:48:59 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        传智播客Python学院爬虫课程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="file/part01/1.html">
            
                
                    <a href="../../file/part01/1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        爬虫原理与数据抓取
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="file/part01/1.1.html">
            
                
                    <a href="../../file/part01/1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        (了解)通用爬虫和聚焦爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="file/part01/1.2.html">
            
                
                    <a href="../../file/part01/1.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        (复习)HTTP/HTTPS的请求与响应
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="file/part01/1.3.html">
            
                
                    <a href="../../file/part01/1.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        HTTP/HTTPS抓包工具-Fiddler
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="file/part01/1.4.html">
            
                
                    <a href="../../file/part01/1.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        urllib2模块的基本使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="file/part01/1.5.html">
            
                
                    <a href="../../file/part01/1.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        urllib2：GET请求和POST请求
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="file/part01/1.6.html">
            
                
                    <a href="../../file/part01/1.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        urllib2：Handler处理器和自定义Opener
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="file/part01/1.7.html">
            
                
                    <a href="../../file/part01/1.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        urllib2：URLError与HTTPError
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="file/part01/1.8.html">
            
                
                    <a href="../../file/part01/1.8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        Requests模块
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="file/part02/2.html">
            
                
                    <a href="../../file/part02/2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        非结构化数据与结构化数据提取
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="file/part02/2.1.html">
            
                
                    <a href="../../file/part02/2.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        正则表达式re模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="file/part02/2.2.html">
            
                
                    <a href="../../file/part02/2.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        案例：使用正则表达式的爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="file/part02/2.3.html">
            
                
                    <a href="../../file/part02/2.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        XPath与lxml类库
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="file/part02/2.4.html">
            
                
                    <a href="../../file/part02/2.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        案例：使用XPath的爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="file/part02/2.5.html">
            
                
                    <a href="../../file/part02/2.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        BeautifulSoup4 解析器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="file/part02/2.6.html">
            
                
                    <a href="../../file/part02/2.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        案例：使用bs4的爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="file/part02/2.7.html">
            
                
                    <a href="../../file/part02/2.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        JSON模块与JsonPath
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="file/part02/2.8.html">
            
                
                    <a href="../../file/part02/2.8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        糗事百科案例
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="file/part02/2.9.html">
            
                
                    <a href="../../file/part02/2.9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        多线程爬虫案例
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="file/part03/3.html">
            
                
                    <a href="../../file/part03/3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        动态HTML处理和机器图像识别
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="file/part03/3.1.html">
            
                
                    <a href="../../file/part03/3.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        动态HTML介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="file/part03/3.2.html">
            
                
                    <a href="../../file/part03/3.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        Selenium与PhantomJS
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="file/part03/3.3.html">
            
                
                    <a href="../../file/part03/3.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        案例一：网站模拟登录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="file/part03/3.4.html">
            
                
                    <a href="../../file/part03/3.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        案例二：动态页面模拟点击
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="file/part03/3.5.html">
            
                
                    <a href="../../file/part03/3.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        案例三：执行JavaScript语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="file/part03/3.6.html">
            
                
                    <a href="../../file/part03/3.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        机器视觉与Tesseract介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="file/part03/3.7.html">
            
                
                    <a href="../../file/part03/3.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        处理一些格式规范的文字
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="file/part03/3.8.html">
            
                
                    <a href="../../file/part03/3.8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        案例：尝试对验证码进行机器识别处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="file/part03/3.9.html">
            
                
                    <a href="../../file/part03/3.9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        机器学习：训练Tesseract
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="file/part04/4.html">
            
                
                    <a href="../../file/part04/4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        Scrapy框架
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="file/part04/4.1.html">
            
                
                    <a href="../../file/part04/4.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        配置安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="file/part04/4.2.html">
            
                
                    <a href="../../file/part04/4.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        入门案例
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="file/part04/4.3.html">
            
                
                    <a href="../../file/part04/4.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        Scrapy Shell
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="file/part04/4.4.html">
            
                
                    <a href="../../file/part04/4.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        Item Pipeline
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="file/part04/4.5.html">
            
                
                    <a href="../../file/part04/4.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        Spiders
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="file/part04/4.6.html">
            
                
                    <a href="../../file/part04/4.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        CrawlSpiders
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="file/part04/4.7.html">
            
                
                    <a href="../../file/part04/4.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        Request/Response
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="file/part04/4.8.html">
            
                
                    <a href="../../file/part04/4.8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.8.</b>
                        
                        Downloader Middlewares
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9" data-path="file/part04/4.9.html">
            
                
                    <a href="../../file/part04/4.9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.</b>
                        
                        Settings
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="file/part05/5.html">
            
                
                    <a href="../../file/part05/5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Scrapy实战项目
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="file/part05/5.1.html">
            
                
                    <a href="../../file/part05/5.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        (案例一)手机App抓包爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="file/part05/5.2.html">
            
                
                    <a href="../../file/part05/5.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        (案例二)阳光热线问政平台爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="file/part05/5.3.html">
            
                
                    <a href="../../file/part05/5.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        (案例三)新浪网分类资讯爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="file/part05/5.4.html">
            
                
                    <a href="../../file/part05/5.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        (案例四)图片下载器爬虫
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="file/part05/5.5.html">
            
                
                    <a href="../../file/part05/5.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        (案例五)将数据保存在MongoDB中
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="file/part05/5.6.html">
            
                
                    <a href="../../file/part05/5.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        (案例六)三种scrapy模拟登陆策略
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="file/part05/5.7.html">
            
                
                    <a href="../../file/part05/5.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        附：通过Fiddler进行手机抓包方法
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="file/part06/6.html">
            
                
                    <a href="../../file/part06/6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        scrapy-redis分布式组件
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="file/part06/6.1.html">
            
                
                    <a href="../../file/part06/6.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        源码分析参考：Connection
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="file/part06/6.2.html">
            
                
                    <a href="../../file/part06/6.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        源码分析参考：Dupefilter
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="file/part06/6.3.html">
            
                
                    <a href="../../file/part06/6.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        源码分析参考：Picklecompat
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="file/part06/6.4.html">
            
                
                    <a href="../../file/part06/6.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        源码分析参考：Pipelines
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="file/part06/6.5.html">
            
                
                    <a href="../../file/part06/6.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        源码分析参考：Queue
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="file/part06/6.6.html">
            
                
                    <a href="../../file/part06/6.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        源码分析参考：Scheduler
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="file/part06/6.7.html">
            
                
                    <a href="../../file/part06/6.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        源码分析参考：Spider
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="file/part07/7.html">
            
                
                    <a href="../../file/part07/7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        scrapy-redis实战
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="7.1" data-path="file/part07/7.1.html">
            
                
                    <a href="../../file/part07/7.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        源码自带项目说明
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="file/part07/7.2.html">
            
                
                    <a href="../../file/part07/7.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        有缘网分布式爬虫项目1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="file/part07/7.3.html">
            
                
                    <a href="../../file/part07/7.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        有缘网分布式爬虫项目2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="file/part07/7.4.html">
            
                
                    <a href="../../file/part07/7.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        处理Redis里的数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="file/part07/7.5.html">
            
                
                    <a href="../../file/part07/7.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        尝试改写新浪网分类资讯爬虫1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="file/part07/7.6.html">
            
                
                    <a href="../../file/part07/7.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        尝试改写新浪网分类资讯爬虫2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7" data-path="file/part07/7.7.html">
            
                
                    <a href="../../file/part07/7.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.</b>
                        
                        IT桔子分布式项目1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.8" data-path="file/part07/7.8.html">
            
                
                    <a href="../../file/part07/7.8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.8.</b>
                        
                        IT桔子分布式项目2
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="file/duanzi/duanzi.html">
            
                
                    <a href="../../file/duanzi/duanzi.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        课余段子
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Python爬虫课程讲义</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="&#x6E90;&#x7801;&#x81EA;&#x5E26;&#x9879;&#x76EE;&#x8BF4;&#x660E;&#xFF1A;">&#x6E90;&#x7801;&#x81EA;&#x5E26;&#x9879;&#x76EE;&#x8BF4;&#x660E;&#xFF1A;</h2>
<h3 id="&#x4F7F;&#x7528;scrapyredis&#x7684;example&#x6765;&#x4FEE;&#x6539;">&#x4F7F;&#x7528;scrapy-redis&#x7684;example&#x6765;&#x4FEE;&#x6539;</h3>
<p>&#x5148;&#x4ECE;github&#x4E0A;&#x62FF;&#x5230;scrapy-redis&#x7684;&#x793A;&#x4F8B;&#xFF0C;&#x7136;&#x540E;&#x5C06;&#x91CC;&#x9762;&#x7684;example-project&#x76EE;&#x5F55;&#x79FB;&#x5230;&#x6307;&#x5B9A;&#x7684;&#x5730;&#x5740;&#xFF1A;</p>
<pre><code class="lang-sh"><span class="hljs-comment"># clone github scrapy-redis&#x6E90;&#x7801;&#x6587;&#x4EF6;</span>
git <span class="hljs-built_in">clone</span> https://github.com/rolando/scrapy-redis.git

<span class="hljs-comment"># &#x76F4;&#x63A5;&#x62FF;&#x5B98;&#x65B9;&#x7684;&#x9879;&#x76EE;&#x8303;&#x4F8B;&#xFF0C;&#x6539;&#x540D;&#x4E3A;&#x81EA;&#x5DF1;&#x7684;&#x9879;&#x76EE;&#x7528;&#xFF08;&#x9488;&#x5BF9;&#x61D2;&#x764C;&#x60A3;&#x8005;)</span>
mv scrapy-redis/example-project ~/scrapyredis-project
</code></pre>
<p>&#x6211;&#x4EEC;clone&#x5230;&#x7684; scrapy-redis &#x6E90;&#x7801;&#x4E2D;&#x6709;&#x81EA;&#x5E26;&#x4E00;&#x4E2A;example-project&#x9879;&#x76EE;&#xFF0C;&#x8FD9;&#x4E2A;&#x9879;&#x76EE;&#x5305;&#x542B;3&#x4E2A;spider&#xFF0C;&#x5206;&#x522B;&#x662F;dmoz, myspider_redis&#xFF0C;mycrawler_redis&#x3002;</p>
<h3 id="&#x4E00;&#x3001;dmoz-class-dmozspidercrawlspider">&#x4E00;&#x3001;dmoz (class DmozSpider(CrawlSpider))</h3>
<p>&#x8FD9;&#x4E2A;&#x722C;&#x866B;&#x7EE7;&#x627F;&#x7684;&#x662F;CrawlSpider&#xFF0C;&#x5B83;&#x662F;&#x7528;&#x6765;&#x8BF4;&#x660E;Redis&#x7684;&#x6301;&#x7EED;&#x6027;&#xFF0C;&#x5F53;&#x6211;&#x4EEC;&#x7B2C;&#x4E00;&#x6B21;&#x8FD0;&#x884C;dmoz&#x722C;&#x866B;&#xFF0C;&#x7136;&#x540E;Ctrl + C&#x505C;&#x6389;&#x4E4B;&#x540E;&#xFF0C;&#x518D;&#x8FD0;&#x884C;dmoz&#x722C;&#x866B;&#xFF0C;&#x4E4B;&#x524D;&#x7684;&#x722C;&#x53D6;&#x8BB0;&#x5F55;&#x662F;&#x4FDD;&#x7559;&#x5728;Redis&#x91CC;&#x7684;&#x3002;</p>
<p>&#x5206;&#x6790;&#x8D77;&#x6765;&#xFF0C;&#x5176;&#x5B9E;&#x8FD9;&#x5C31;&#x662F;&#x4E00;&#x4E2A; scrapy-redis &#x7248; <code>CrawlSpider</code> &#x7C7B;&#xFF0C;&#x9700;&#x8981;&#x8BBE;&#x7F6E;Rule&#x89C4;&#x5219;&#xFF0C;&#x4EE5;&#x53CA;callback&#x4E0D;&#x80FD;&#x5199;parse()&#x65B9;&#x6CD5;&#x3002;</p>
<h4 id="&#x6267;&#x884C;&#x65B9;&#x5F0F;&#xFF1A;scrapy-crawl-dmoz">&#x6267;&#x884C;&#x65B9;&#x5F0F;&#xFF1A;<code>scrapy crawl dmoz</code></h4>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> scrapy.linkextractors <span class="hljs-keyword">import</span> LinkExtractor
<span class="hljs-keyword">from</span> scrapy.spiders <span class="hljs-keyword">import</span> CrawlSpider, Rule


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DmozSpider</span><span class="hljs-params">(CrawlSpider)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;Follow categories and extract links.&quot;&quot;&quot;</span>
    name = <span class="hljs-string">&apos;dmoz&apos;</span>
    allowed_domains = [<span class="hljs-string">&apos;dmoz.org&apos;</span>]
    start_urls = [<span class="hljs-string">&apos;http://www.dmoz.org/&apos;</span>]

    rules = [
        Rule(LinkExtractor(
            restrict_css=(<span class="hljs-string">&apos;.top-cat&apos;</span>, <span class="hljs-string">&apos;.sub-cat&apos;</span>, <span class="hljs-string">&apos;.cat-item&apos;</span>)
        ), callback=<span class="hljs-string">&apos;parse_directory&apos;</span>, follow=<span class="hljs-keyword">True</span>),
    ]

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">parse_directory</span><span class="hljs-params">(self, response)</span>:</span>
        <span class="hljs-keyword">for</span> div <span class="hljs-keyword">in</span> response.css(<span class="hljs-string">&apos;.title-and-desc&apos;</span>):
            <span class="hljs-keyword">yield</span> {
                <span class="hljs-string">&apos;name&apos;</span>: div.css(<span class="hljs-string">&apos;.site-title::text&apos;</span>).extract_first(),
                <span class="hljs-string">&apos;description&apos;</span>: div.css(<span class="hljs-string">&apos;.site-descr::text&apos;</span>).extract_first().strip(),
                <span class="hljs-string">&apos;link&apos;</span>: div.css(<span class="hljs-string">&apos;a::attr(href)&apos;</span>).extract_first(),
            }
</code></pre>
<h3 id="&#x4E8C;&#x3001;myspiderredis-class-myspiderredisspider">&#x4E8C;&#x3001;myspider_redis (class MySpider(RedisSpider))</h3>
<p>&#x8FD9;&#x4E2A;&#x722C;&#x866B;&#x7EE7;&#x627F;&#x4E86;RedisSpider&#xFF0C; &#x5B83;&#x80FD;&#x591F;&#x652F;&#x6301;&#x5206;&#x5E03;&#x5F0F;&#x7684;&#x6293;&#x53D6;&#xFF0C;&#x91C7;&#x7528;&#x7684;&#x662F;basic spider&#xFF0C;&#x9700;&#x8981;&#x5199;parse&#x51FD;&#x6570;&#x3002;</p>
<p>&#x5176;&#x6B21;&#x5C31;&#x662F;&#x4E0D;&#x518D;&#x6709;start_urls&#x4E86;&#xFF0C;&#x53D6;&#x800C;&#x4EE3;&#x4E4B;&#x7684;&#x662F;redis_key&#xFF0C;scrapy-redis&#x5C06;key&#x4ECE;Redis&#x91CC;pop&#x51FA;&#x6765;&#xFF0C;&#x6210;&#x4E3A;&#x8BF7;&#x6C42;&#x7684;url&#x5730;&#x5740;&#x3002;</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> scrapy_redis.spiders <span class="hljs-keyword">import</span> RedisSpider


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MySpider</span><span class="hljs-params">(RedisSpider)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;Spider that reads urls from redis queue (myspider:start_urls).&quot;&quot;&quot;</span>
    name = <span class="hljs-string">&apos;myspider_redis&apos;</span>

    <span class="hljs-comment"># &#x6CE8;&#x610F;redis-key&#x7684;&#x683C;&#x5F0F;&#xFF1A;</span>
    redis_key = <span class="hljs-string">&apos;myspider:start_urls&apos;</span>

    <span class="hljs-comment"># &#x53EF;&#x9009;&#xFF1A;&#x7B49;&#x6548;&#x4E8E;allowd_domains()&#xFF0C;__init__&#x65B9;&#x6CD5;&#x6309;&#x89C4;&#x5B9A;&#x683C;&#x5F0F;&#x5199;&#xFF0C;&#x4F7F;&#x7528;&#x65F6;&#x53EA;&#x9700;&#x8981;&#x4FEE;&#x6539;super()&#x91CC;&#x7684;&#x7C7B;&#x540D;&#x53C2;&#x6570;&#x5373;&#x53EF;</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, *args, **kwargs)</span>:</span>
        <span class="hljs-comment"># Dynamically define the allowed domains list.</span>
        domain = kwargs.pop(<span class="hljs-string">&apos;domain&apos;</span>, <span class="hljs-string">&apos;&apos;</span>)
        self.allowed_domains = filter(<span class="hljs-keyword">None</span>, domain.split(<span class="hljs-string">&apos;,&apos;</span>))

        <span class="hljs-comment"># &#x4FEE;&#x6539;&#x8FD9;&#x91CC;&#x7684;&#x7C7B;&#x540D;&#x4E3A;&#x5F53;&#x524D;&#x7C7B;&#x540D;</span>
        super(MySpider, self).__init__(*args, **kwargs)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">parse</span><span class="hljs-params">(self, response)</span>:</span>
        <span class="hljs-keyword">return</span> {
            <span class="hljs-string">&apos;name&apos;</span>: response.css(<span class="hljs-string">&apos;title::text&apos;</span>).extract_first(),
            <span class="hljs-string">&apos;url&apos;</span>: response.url,
        }
</code></pre>
<h4 id="&#x6CE8;&#x610F;&#xFF1A;">&#x6CE8;&#x610F;&#xFF1A;</h4>
<p>RedisSpider&#x7C7B; &#x4E0D;&#x9700;&#x8981;&#x5199;<code>allowd_domains</code>&#x548C;<code>start_urls</code>&#xFF1A;</p>
<ol>
<li><p>scrapy-redis&#x5C06;&#x4ECE;&#x5728;&#x6784;&#x9020;&#x65B9;&#x6CD5;<code>__init__()</code>&#x91CC;&#x52A8;&#x6001;&#x5B9A;&#x4E49;&#x722C;&#x866B;&#x722C;&#x53D6;&#x57DF;&#x8303;&#x56F4;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x76F4;&#x63A5;&#x5199;<code>allowd_domains</code>&#x3002;</p>
</li>
<li><p>&#x5FC5;&#x987B;&#x6307;&#x5B9A;redis_key&#xFF0C;&#x5373;&#x542F;&#x52A8;&#x722C;&#x866B;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x53C2;&#x8003;&#x683C;&#x5F0F;&#xFF1A;<code>redis_key = &apos;myspider:start_urls&apos;</code></p>
</li>
<li><p>&#x6839;&#x636E;&#x6307;&#x5B9A;&#x7684;&#x683C;&#x5F0F;&#xFF0C;<code>start_urls</code>&#x5C06;&#x5728; Master&#x7AEF;&#x7684; redis-cli &#x91CC; lpush &#x5230; Redis&#x6570;&#x636E;&#x5E93;&#x91CC;&#xFF0C;RedisSpider &#x5C06;&#x5728;&#x6570;&#x636E;&#x5E93;&#x91CC;&#x83B7;&#x53D6;start_urls&#x3002;</p>
</li>
</ol>
<h4 id="&#x6267;&#x884C;&#x65B9;&#x5F0F;&#xFF1A;">&#x6267;&#x884C;&#x65B9;&#x5F0F;&#xFF1A;</h4>
<ol>
<li><p>&#x901A;&#x8FC7;runspider&#x65B9;&#x6CD5;&#x6267;&#x884C;&#x722C;&#x866B;&#x7684;py&#x6587;&#x4EF6;&#xFF08;&#x4E5F;&#x53EF;&#x4EE5;&#x5206;&#x6B21;&#x6267;&#x884C;&#x591A;&#x6761;&#xFF09;&#xFF0C;&#x722C;&#x866B;&#xFF08;&#x4EEC;&#xFF09;&#x5C06;&#x5904;&#x4E8E;&#x7B49;&#x5F85;&#x51C6;&#x5907;&#x72B6;&#x6001;&#xFF1A;</p>
<h4 id="scrapy-runspider-myspiderredispy"><code>scrapy runspider myspider_redis.py</code></h4>
</li>
<li><p>&#x5728;Master&#x7AEF;&#x7684;redis-cli&#x8F93;&#x5165;push&#x6307;&#x4EE4;&#xFF0C;&#x53C2;&#x8003;&#x683C;&#x5F0F;&#xFF1A;</p>
<h4 id="redis--lpush-myspiderstarturls-httpwwwdmozorg"><code>$redis &gt; lpush myspider:start_urls http://www.dmoz.org/</code></h4>
</li>
<li><p>Slaver&#x7AEF;&#x722C;&#x866B;&#x83B7;&#x53D6;&#x5230;&#x8BF7;&#x6C42;&#xFF0C;&#x5F00;&#x59CB;&#x722C;&#x53D6;&#x3002;</p>
</li>
</ol>
<h3 id="&#x4E09;&#x3001;mycrawlerredis-class-mycrawlerrediscrawlspider">&#x4E09;&#x3001;mycrawler_redis (class MyCrawler(RedisCrawlSpider))</h3>
<p>&#x8FD9;&#x4E2A;RedisCrawlSpider&#x7C7B;&#x722C;&#x866B;&#x7EE7;&#x627F;&#x4E86;RedisCrawlSpider&#xFF0C;&#x80FD;&#x591F;&#x652F;&#x6301;&#x5206;&#x5E03;&#x5F0F;&#x7684;&#x6293;&#x53D6;&#x3002;&#x56E0;&#x4E3A;&#x91C7;&#x7528;&#x7684;&#x662F;crawlSpider&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x9075;&#x5B88;Rule&#x89C4;&#x5219;&#xFF0C;&#x4EE5;&#x53CA;callback&#x4E0D;&#x80FD;&#x5199;parse()&#x65B9;&#x6CD5;&#x3002;</p>
<p>&#x540C;&#x6837;&#x4E5F;&#x4E0D;&#x518D;&#x6709;start_urls&#x4E86;&#xFF0C;&#x53D6;&#x800C;&#x4EE3;&#x4E4B;&#x7684;&#x662F;redis_key&#xFF0C;scrapy-redis&#x5C06;key&#x4ECE;Redis&#x91CC;pop&#x51FA;&#x6765;&#xFF0C;&#x6210;&#x4E3A;&#x8BF7;&#x6C42;&#x7684;url&#x5730;&#x5740;&#x3002;</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> scrapy.spiders <span class="hljs-keyword">import</span> Rule
<span class="hljs-keyword">from</span> scrapy.linkextractors <span class="hljs-keyword">import</span> LinkExtractor

<span class="hljs-keyword">from</span> scrapy_redis.spiders <span class="hljs-keyword">import</span> RedisCrawlSpider


<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyCrawler</span><span class="hljs-params">(RedisCrawlSpider)</span>:</span>
    <span class="hljs-string">&quot;&quot;&quot;Spider that reads urls from redis queue (myspider:start_urls).&quot;&quot;&quot;</span>
    name = <span class="hljs-string">&apos;mycrawler_redis&apos;</span>
    redis_key = <span class="hljs-string">&apos;mycrawler:start_urls&apos;</span>

    rules = (
        <span class="hljs-comment"># follow all links</span>
        Rule(LinkExtractor(), callback=<span class="hljs-string">&apos;parse_page&apos;</span>, follow=<span class="hljs-keyword">True</span>),
    )

    <span class="hljs-comment"># __init__&#x65B9;&#x6CD5;&#x5FC5;&#x987B;&#x6309;&#x89C4;&#x5B9A;&#x5199;&#xFF0C;&#x4F7F;&#x7528;&#x65F6;&#x53EA;&#x9700;&#x8981;&#x4FEE;&#x6539;super()&#x91CC;&#x7684;&#x7C7B;&#x540D;&#x53C2;&#x6570;&#x5373;&#x53EF;</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, *args, **kwargs)</span>:</span>
        <span class="hljs-comment"># Dynamically define the allowed domains list.</span>
        domain = kwargs.pop(<span class="hljs-string">&apos;domain&apos;</span>, <span class="hljs-string">&apos;&apos;</span>)
        self.allowed_domains = filter(<span class="hljs-keyword">None</span>, domain.split(<span class="hljs-string">&apos;,&apos;</span>))

        <span class="hljs-comment"># &#x4FEE;&#x6539;&#x8FD9;&#x91CC;&#x7684;&#x7C7B;&#x540D;&#x4E3A;&#x5F53;&#x524D;&#x7C7B;&#x540D;</span>
        super(MyCrawler, self).__init__(*args, **kwargs)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">parse_page</span><span class="hljs-params">(self, response)</span>:</span>
        <span class="hljs-keyword">return</span> {
            <span class="hljs-string">&apos;name&apos;</span>: response.css(<span class="hljs-string">&apos;title::text&apos;</span>).extract_first(),
            <span class="hljs-string">&apos;url&apos;</span>: response.url,
        }
</code></pre>
<h4 id="&#x6CE8;&#x610F;&#xFF1A;">&#x6CE8;&#x610F;&#xFF1A;</h4>
<p>&#x540C;&#x6837;&#x7684;&#xFF0C;RedisCrawlSpider&#x7C7B;&#x4E0D;&#x9700;&#x8981;&#x5199;<code>allowd_domains</code>&#x548C;<code>start_urls</code>&#xFF1A;</p>
<ol>
<li><p>scrapy-redis&#x5C06;&#x4ECE;&#x5728;&#x6784;&#x9020;&#x65B9;&#x6CD5;<code>__init__()</code>&#x91CC;&#x52A8;&#x6001;&#x5B9A;&#x4E49;&#x722C;&#x866B;&#x722C;&#x53D6;&#x57DF;&#x8303;&#x56F4;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x76F4;&#x63A5;&#x5199;<code>allowd_domains</code>&#x3002;</p>
</li>
<li><p>&#x5FC5;&#x987B;&#x6307;&#x5B9A;redis_key&#xFF0C;&#x5373;&#x542F;&#x52A8;&#x722C;&#x866B;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x53C2;&#x8003;&#x683C;&#x5F0F;&#xFF1A;<code>redis_key = &apos;myspider:start_urls&apos;</code></p>
</li>
<li><p>&#x6839;&#x636E;&#x6307;&#x5B9A;&#x7684;&#x683C;&#x5F0F;&#xFF0C;<code>start_urls</code>&#x5C06;&#x5728; Master&#x7AEF;&#x7684; redis-cli &#x91CC; lpush &#x5230; Redis&#x6570;&#x636E;&#x5E93;&#x91CC;&#xFF0C;RedisSpider &#x5C06;&#x5728;&#x6570;&#x636E;&#x5E93;&#x91CC;&#x83B7;&#x53D6;start_urls&#x3002;</p>
</li>
</ol>
<h4 id="&#x6267;&#x884C;&#x65B9;&#x5F0F;&#xFF1A;">&#x6267;&#x884C;&#x65B9;&#x5F0F;&#xFF1A;</h4>
<ol>
<li><p>&#x901A;&#x8FC7;runspider&#x65B9;&#x6CD5;&#x6267;&#x884C;&#x722C;&#x866B;&#x7684;py&#x6587;&#x4EF6;&#xFF08;&#x4E5F;&#x53EF;&#x4EE5;&#x5206;&#x6B21;&#x6267;&#x884C;&#x591A;&#x6761;&#xFF09;&#xFF0C;&#x722C;&#x866B;&#xFF08;&#x4EEC;&#xFF09;&#x5C06;&#x5904;&#x4E8E;&#x7B49;&#x5F85;&#x51C6;&#x5907;&#x72B6;&#x6001;&#xFF1A;</p>
<h4 id="scrapy-runspider-mycrawlerredispy"><code>scrapy runspider mycrawler_redis.py</code></h4>
</li>
<li><p>&#x5728;Master&#x7AEF;&#x7684;redis-cli&#x8F93;&#x5165;push&#x6307;&#x4EE4;&#xFF0C;&#x53C2;&#x8003;&#x683C;&#x5F0F;&#xFF1A;</p>
<h4 id="redis--lpush-mycrawlerstarturls-httpwwwdmozorg"><code>$redis &gt; lpush mycrawler:start_urls http://www.dmoz.org/</code></h4>
</li>
<li><p>&#x722C;&#x866B;&#x83B7;&#x53D6;url&#xFF0C;&#x5F00;&#x59CB;&#x6267;&#x884C;&#x3002;</p>
</li>
</ol>
<h2 id="&#x603B;&#x7ED3;&#xFF1A;">&#x603B;&#x7ED3;&#xFF1A;</h2>
<ol>
<li><p>&#x5982;&#x679C;&#x53EA;&#x662F;&#x7528;&#x5230;Redis&#x7684;&#x53BB;&#x91CD;&#x548C;&#x4FDD;&#x5B58;&#x529F;&#x80FD;&#xFF0C;&#x5C31;&#x9009;&#x7B2C;&#x4E00;&#x79CD;&#xFF1B;</p>
</li>
<li><p>&#x5982;&#x679C;&#x8981;&#x5199;&#x5206;&#x5E03;&#x5F0F;&#xFF0C;&#x5219;&#x6839;&#x636E;&#x60C5;&#x51B5;&#xFF0C;&#x9009;&#x62E9;&#x7B2C;&#x4E8C;&#x79CD;&#x3001;&#x7B2C;&#x4E09;&#x79CD;&#xFF1B;</p>
</li>
<li><p>&#x901A;&#x5E38;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x4F1A;&#x9009;&#x62E9;&#x7528;&#x7B2C;&#x4E09;&#x79CD;&#x65B9;&#x5F0F;&#x7F16;&#x5199;&#x6DF1;&#x5EA6;&#x805A;&#x7126;&#x722C;&#x866B;&#x3002; </p>
</li>
</ol>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; BigCat all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x300C;Revision Time:
2017-02-05 23:39:53&#x300D;
</span></footer>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../file/part07/7.html" class="navigation navigation-prev " aria-label="Previous page: scrapy-redis实战"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../file/part07/7.2.html" class="navigation navigation-next " aria-label="Next page: 有缘网分布式爬虫项目1"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"disqus":{"shortName":"gitbookuse"},"github":{"url":"https://github.com/dododream"},"search-pro":{"cutWordLib":"nodejieba","defineWord":["gitbook-use"]},"sharing":{"weibo":true,"facebook":true,"twitter":true,"google":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"tbfed-pagefooter":{"copyright":"Copyright © BigCat","modify_label":"「Revision Time:","modify_format":"YYYY-MM-DD HH:mm:ss」"},"baidu":{"token":"ff100361cdce95dd4c8fb96b4009f7bc"},"sitemap":{"hostname":"http://www.treenewbee.top"},"donate":{"wechat":"http://weixin.png","alipay":"http://alipay.png","title":"","button":"赏","alipayText":"支付宝打赏","wechatText":"微信打赏"},"edit-link":{"base":"https://github.com/dododream/edit","label":"Edit This Page"},"splitter":{},"toggle-chapters":{},"highlight":{},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book Python爬虫课程讲义 -->
</html>
